package service.search;

import bean.search.ClassSearch;
import client.MnueClient;
import dao.search.ClassSearchDao;
import service.menu.PersonMenuService;

import java.sql.SQLException;
import java.text.ParseException;
import java.util.List;
import java.util.Scanner;


/**
 * 班级查询逻辑实现类
 * */
public class ClassSearchService {
    public void show() throws SQLException, ParseException {
        ClassSearchDao csd = new ClassSearchDao();


        Scanner scanner = new Scanner(System.in);

        System.out.println("请输入需要查询的班级名称：");
        String cName = scanner.next();
        List<ClassSearch> listClassSearch = csd.classSearch(cName);
        for (ClassSearch classSearch : listClassSearch) {
            System.out.println(classSearch);
        }
        System.out.println("输入0返回上一层菜单");
        int a = scanner.nextInt();
        if(0 == a){PersonMenuService pms = new PersonMenuService();
            pms.messageSys();
        }
    }

}
